
<template>
  <el-form :model="form" ref="form" :inline="true">
    <el-row :inline="true">
      <!-- <el-form-item label="方案编码" prop="strategyCode">
        <el-input v-model="form.strategyCode" placeholder="请输入方案编码" />
      </el-form-item>
      <el-form-item label="方案名称" prop="strategyName">
        <el-input v-model="form.strategyName" placeholder="请输入方案名称" />
      </el-form-item>
      <el-form-item label="优先级" prop="priorityLevel">
        <el-input v-model="form.priorityLevel" placeholder="请输入优先级" />
      </el-form-item>
      <el-form-item label="配货来源" prop="allocationSource">
        <el-input
          v-model="form.allocationSource"
          placeholder="请输入配货来源"
        />
      </el-form-item>
      <el-form-item label="品牌" prop="brand">
        <el-input v-model="form.brand" placeholder="请输入品牌" />
      </el-form-item>
      <el-form-item label="生效开始日期" prop="effectiveStartDate">
        <el-date-picker
          clearable
          v-model="form.effectiveStartDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择生效开始日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="生效结束日期" prop="effectiveEndDate">
        <el-date-picker
          clearable
          v-model="form.effectiveEndDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择生效结束日期"
        >
        </el-date-picker>
      </el-form-item> -->
    </el-row>
    <el-form-item style="width: 100%; text-align: center">
      <!-- <el-button @click="submitnote('noticForm')" type="primary"
        >笔记合作</el-button
      > -->
      <el-button style="margin-top: 12px" @click="prev">上一步</el-button>
      <el-button style="margin-top: 12px" @click="next">下一步</el-button>
      <!-- <el-button @click="resetForm" style="margin-left: 10px"
        >一键清空</el-button
      > -->
    </el-form-item>
  </el-form>
</template>
<script>
import {
  listStrategy,
  getStrategy,
  delStrategy,
  addStrategy,
  updateStrategy,
} from "@/api/productAllocation/strategy";
export default {
  props: {
    row: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      // 表单参数
      form: {},
    };
  },
  watch: {
    row: {
      handler: function (newnew, oldold) {
        console.log("newnew", newnew);
        if (newnew) {
          this.form = newnew;
          // this.form.id=newnew
        }
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    prev() {
      //   this.submitForm();
      this.$emit("prev");
    },
    next() {
      //   this.submitForm();
      this.$emit("next");
    },
    /** 提交按钮 */
    // submitForm() {
    //   this.$refs["form"].validate((valid) => {
    //     if (valid) {
    //       if (this.form.id != null) {
    //         updateStrategy(this.form).then((response) => {
    //           this.$modal.msgSuccess("修改成功");
    //           this.open = false;
    //           this.getList();
    //         });
    //       } else {
    //         addStrategy(this.form).then((response) => {
    //           this.$modal.msgSuccess("新增成功");
    //           this.open = false;
    //           this.getList();
    //         });
    //       }
    //     }
    //   });
    // },
  },
};
</script>